<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Streaming algorithm</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Streaming_algorithm"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Streaming_algorithm rootpage-Streaming_algorithm skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Streaming algorithm</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Computer_science" title="Computer science">computer science</a>, <b>streaming algorithms</b> process input <a href="Data_stream" title="Data stream">data streams</a> as a <a href="Sequence" title="Sequence">sequence</a> of items, typically making just <a href="One-pass_algorithm" title="One-pass algorithm">one pass</a> (or a few passes) through the data. These algorithms are designed to operate with limited memory, generally <a href="L_(complexity)" title="L (complexity)">logarithmic</a> in the size of the stream and/or in the maximum value in the stream, and may also have limited processing time per item.
</p><p>As a result of these constraints, streaming algorithms often produce approximate answers based on a summary or "sketch" of the data stream.
</p>
<style data-mw-deduplicate="TemplateStyles:r886046785">
/* start https://en.wikipedia.org/ */
.mw-parser-output .toclimit-2 .toclevel-1 ul,.mw-parser-output .toclimit-3 .toclevel-2 ul,.mw-parser-output .toclimit-4 .toclevel-3 ul,.mw-parser-output .toclimit-5 .toclevel-4 ul,.mw-parser-output .toclimit-6 .toclevel-5 ul,.mw-parser-output .toclimit-7 .toclevel-6 ul{display:none}
/* end https://en.wikipedia.org/ */
</style><div class="toclimit-3"><meta property="mw:PageProp/toc"></div>
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>Though streaming algorithms had already been studied by Munro and Paterson<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> as early as 1978, as well as <a href="Philippe_Flajolet" title="Philippe Flajolet">Philippe Flajolet</a> and G. Nigel Martin in 1982/83,<sup id="cite_ref-:0_2-0" class="reference"><a href="#cite_note-:0-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> the field of streaming algorithms was first formalized and popularized in a 1996 paper by <a href="Noga_Alon" title="Noga Alon">Noga Alon</a>, <a href="Yossi_Matias" title="Yossi Matias">Yossi Matias</a>, and <a href="Mario_Szegedy" title="Mario Szegedy">Mario Szegedy</a>.<sup id="cite_ref-:1_3-0" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> For this paper, the authors later won the <a href="G%C3%B6del_Prize" title="Gödel Prize">Gödel Prize</a> in 2005 "for their foundational contribution to streaming algorithms." There has since been a large body of work centered around data streaming algorithms that spans a diverse spectrum of computer science fields such as theory, databases, networking, and natural language processing.
</p><p>Semi-streaming algorithms were introduced in 2005 as a relaxation of streaming algorithms for graphs,<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> in which the space allowed is linear in the number of vertices <var style="padding-right: 1px;">n</var>, but only logarithmic in the number of edges <var style="padding-right: 1px;">m</var>. This relaxation is still meaningful for dense graphs, and can solve interesting problems (such as connectivity) that are insoluble in <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle o(n)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>o</mi>
<mo stretchy="false">(</mo>
<mi>n</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle o(n)}</annotation>
</semantics>
</math></span><img src="./afdac2125205278017cf549e9b004f8f6fd829c6.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.332ex; height:2.843ex;" alt="{\displaystyle o(n)}" loading="lazy"></span> space.
</p>
<div class="mw-heading mw-heading2"><h2 id="Models">Models</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Data_stream_model">Data stream model</h3></div>
<p>In the data stream model, some or all of the input is represented as a finite sequence of integers (from some finite domain) which is generally not available for <a href="Random_access" title="Random access">random access</a>, but instead arrives one at a time in a "stream".<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> If the stream has length <var style="padding-right: 1px;">n</var> and the domain has size <var style="padding-right: 1px;">m</var>, algorithms are generally constrained to use space that is <a href="L_(complexity)" title="L (complexity)">logarithmic</a> in <var style="padding-right: 1px;">m</var> and <var style="padding-right: 1px;">n</var>. They can generally make only some small constant number of passes over the stream, sometimes just <a href="One-pass_algorithm" title="One-pass algorithm">one</a>.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Turnstile_and_cash_register_models">Turnstile and cash register models</h3></div>
<p>Much of the streaming literature is concerned with computing statistics on
frequency distributions that are too large to be stored. For this class of
problems, there is a vector <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {a} =(a_{1},\dots ,a_{n})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
<mo>=</mo>
<mo stretchy="false">(</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {a} =(a_{1},\dots ,a_{n})}</annotation>
</semantics>
</math></span><img src="./edb03646ff4cce57a23334bb76c80d6b4ccd6f67.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.118ex; height:2.843ex;" alt="{\displaystyle \mathbf {a} =(a_{1},\dots ,a_{n})}" loading="lazy"></span>
(initialized to the zero vector <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {0} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mn mathvariant="bold">0</mn>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {0} }</annotation>
</semantics>
</math></span><img src="./62e8c650763635a93ddc69768c3c0c100afe985d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.337ex; height:2.176ex;" alt="{\displaystyle \mathbf {0} }" loading="lazy"></span>) that has updates presented to it in a stream. The goal of these algorithms is to compute
functions of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {a} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {a} }</annotation>
</semantics>
</math></span><img src="./1a957216653a9ee0d0133dcefd13fb75e36b8b9d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.299ex; height:1.676ex;" alt="{\displaystyle \mathbf {a} }" loading="lazy"></span> using considerably less space than it
would take to represent <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {a} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {a} }</annotation>
</semantics>
</math></span><img src="./1a957216653a9ee0d0133dcefd13fb75e36b8b9d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.299ex; height:1.676ex;" alt="{\displaystyle \mathbf {a} }" loading="lazy"></span> precisely. There are two
common models for updating such streams, called the "cash register" and
"turnstile" models.<sup id="cite_ref-turnstile_7-0" class="reference"><a href="#cite_note-turnstile-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><p>In the cash register model, each update is of the form <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \langle i,c\rangle }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">⟨<!-- ⟨ --></mo>
<mi>i</mi>
<mo>,</mo>
<mi>c</mi>
<mo fence="false" stretchy="false">⟩<!-- ⟩ --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \langle i,c\rangle }</annotation>
</semantics>
</math></span><img src="./49a2255dcc99aad2487ea2c162a5558d0e0986f5.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.653ex; height:2.843ex;" alt="{\displaystyle \langle i,c\rangle }" loading="lazy"></span>, so that <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{i}}</annotation>
</semantics>
</math></span><img src="./0bc77764b2e74e64a63341054fa90f3e07db275f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.029ex; height:2.009ex;" alt="{\displaystyle a_{i}}" loading="lazy"></span> is incremented by some positive
integer <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>c</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle c}</annotation>
</semantics>
</math></span><img src="./86a67b81c2de995bd608d5b2df50cd8cd7d92455.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.007ex; height:1.676ex;" alt="{\displaystyle c}" loading="lazy"></span>. A notable special case is when <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c=1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>c</mi>
<mo>=</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle c=1}</annotation>
</semantics>
</math></span><img src="./3e3467f9e219a5ea38a30da5c3a02c2c23f61a79.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.268ex; height:2.176ex;" alt="{\displaystyle c=1}" loading="lazy"></span>
(only unit insertions are permitted).
</p><p>In the turnstile model, each update is of the form <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \langle i,c\rangle }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">⟨<!-- ⟨ --></mo>
<mi>i</mi>
<mo>,</mo>
<mi>c</mi>
<mo fence="false" stretchy="false">⟩<!-- ⟩ --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \langle i,c\rangle }</annotation>
</semantics>
</math></span><img src="./49a2255dcc99aad2487ea2c162a5558d0e0986f5.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.653ex; height:2.843ex;" alt="{\displaystyle \langle i,c\rangle }" loading="lazy"></span>, so that <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{i}}</annotation>
</semantics>
</math></span><img src="./0bc77764b2e74e64a63341054fa90f3e07db275f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.029ex; height:2.009ex;" alt="{\displaystyle a_{i}}" loading="lazy"></span> is incremented by some (possibly negative) integer <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>c</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle c}</annotation>
</semantics>
</math></span><img src="./86a67b81c2de995bd608d5b2df50cd8cd7d92455.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.007ex; height:1.676ex;" alt="{\displaystyle c}" loading="lazy"></span>. In the "strict turnstile" model, no
<span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{i}}</annotation>
</semantics>
</math></span><img src="./0bc77764b2e74e64a63341054fa90f3e07db275f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.029ex; height:2.009ex;" alt="{\displaystyle a_{i}}" loading="lazy"></span> at any time may be less than zero.
</p>
<div class="mw-heading mw-heading3"><h3 id="Sliding_window_model">Sliding window model</h3></div>
<p>Several papers also consider the "sliding window" model. In this model,
the function of interest is computing over a fixed-size window in the
stream. As the stream progresses, items from the end of the window are
removed from consideration while new items from the stream take their
place.
</p><p>Besides the above frequency-based problems, some other types of problems
have also been studied. Many graph problems are solved in the setting
where the <a href="Adjacency_matrix" title="Adjacency matrix">adjacency matrix</a> or the <a href="Adjacency_list" title="Adjacency list">adjacency list</a> of the graph is streamed in
some unknown order. There are also some problems that are very dependent
on the order of the stream (i.e., asymmetric functions), such as counting
the number of inversions in a stream and finding the longest increasing
subsequence.
</p>
<div class="mw-heading mw-heading2"><h2 id="Evaluation">Evaluation</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>The performance of an algorithm that operates on data streams is measured by three basic factors:
</p>
<ul><li>The number of passes the algorithm must make over the stream.</li>
<li>The available memory.</li>
<li>The running time of the algorithm.</li></ul>
<p>These algorithms have many similarities with <a href="Online_algorithms" class="mw-redirect" title="Online algorithms">online algorithms</a> since they both require decisions to be made before all data are available, but they are not identical. Data stream algorithms only have limited memory available but they may be able to defer action until a group of points arrive, while online algorithms are required to take action as soon as each point arrives.
</p><p>If the algorithm is an approximation algorithm then the accuracy of the answer is another key factor. The accuracy is often stated as an <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (\epsilon ,\delta )}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mi>ϵ<!-- ϵ --></mi>
<mo>,</mo>
<mi>δ<!-- δ --></mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (\epsilon ,\delta )}</annotation>
</semantics>
</math></span><img src="./7c713274f5fc4c0c8a1a8e561c72314c0c5f0db6.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.836ex; height:2.843ex;" alt="{\displaystyle (\epsilon ,\delta )}" loading="lazy"></span> approximation meaning that the algorithm achieves an error of less than <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>ϵ<!-- ϵ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation>
</semantics>
</math></span><img src="./c3837cad72483d97bcdde49c85d3b7b859fb3fd2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }" loading="lazy"></span> with probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1-\delta }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>1</mn>
<mo>−<!-- − --></mo>
<mi>δ<!-- δ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 1-\delta }</annotation>
</semantics>
</math></span><img src="./e7fc18b68a939b8f9eb465e354a64164a1202901.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.052ex; height:2.509ex;" alt="{\displaystyle 1-\delta }" loading="lazy"></span>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Applications">Applications</h2></div>
<p>Streaming algorithms have several applications in <a href="Computer_network" title="Computer network">networking</a> such as
monitoring network links for <a href="Elephant_flow" title="Elephant flow">elephant flows</a>, counting the number of
distinct flows, estimating the distribution of flow sizes, and so
on.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> They also have applications in
databases, such as estimating the size of a <a href="Join_(SQL)" title="Join (SQL)">join</a> .
</p>
<div class="mw-heading mw-heading2"><h2 id="Some_streaming_problems">Some streaming problems</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Frequency_moments">Frequency moments</h3></div>
<p>The <span class="texhtml mvar" style="font-style:italic;">k</span>th frequency moment of a set of frequencies <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {a} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {a} }</annotation>
</semantics>
</math></span><img src="./1a957216653a9ee0d0133dcefd13fb75e36b8b9d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.299ex; height:1.676ex;" alt="{\displaystyle \mathbf {a} }" loading="lazy"></span> is defined as <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{k}(\mathbf {a} )=\sum _{i=1}^{n}a_{i}^{k}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>=</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<msubsup>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{k}(\mathbf {a} )=\sum _{i=1}^{n}a_{i}^{k}}</annotation>
</semantics>
</math></span><img src="./a6a6b311afa34a08b23a15dedb46fa46c49534ad.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:14.851ex; height:6.843ex;" alt="{\displaystyle F_{k}(\mathbf {a} )=\sum _{i=1}^{n}a_{i}^{k}}" loading="lazy"></span>.
</p><p>The first moment <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{1}}</annotation>
</semantics>
</math></span><img src="./100c7fbf174fe8b06eacc2a6b0bb2e1badd1c7ce.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.549ex; height:2.509ex;" alt="{\displaystyle F_{1}}" loading="lazy"></span> is simply the sum of the frequencies (i.e., the total count). The second moment <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{2}}</annotation>
</semantics>
</math></span><img src="./0fd17e0779153d765b40ebef91533489b87b2e37.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.549ex; height:2.509ex;" alt="{\displaystyle F_{2}}" loading="lazy"></span> is useful for computing statistical properties of the data, such as the <a href="Gini_coefficient" title="Gini coefficient">Gini coefficient</a>
of variation. <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{\infty }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{\infty }}</annotation>
</semantics>
</math></span><img src="./6779bbb6d4509c87dd7231ebf8945cccc5771e48.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.37ex; height:2.509ex;" alt="{\displaystyle F_{\infty }}" loading="lazy"></span> is defined as the frequency of the most frequent items.
</p><p>The seminal paper of Alon, Matias, and Szegedy dealt with the problem of estimating the frequency moments.
</p>
<div class="mw-heading mw-heading4"><h4 id="Calculating_frequency_moments">Calculating frequency moments</h4></div>
<p>A direct approach to find the frequency moments requires to maintain a register <span class="texhtml mvar" style="font-style:italic;">m<sub>i</sub></span> for all distinct elements <span class="texhtml"><i>a</i><sub><i>i</i></sub> ∈ (1,2,3,4,...,<i>N</i>)</span> which requires at least memory
of order <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Omega (N)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">Ω<!-- Ω --></mi>
<mo stretchy="false">(</mo>
<mi>N</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \Omega (N)}</annotation>
</semantics>
</math></span><img src="./577727c452671a036afca43509f0da81ddd7a7ce.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.551ex; height:2.843ex;" alt="{\displaystyle \Omega (N)}" loading="lazy"></span>.<sup id="cite_ref-:1_3-1" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> But we have space limitations and require an algorithm that computes in much lower memory. This can be achieved by using approximations instead of exact values. An algorithm that computes an (<i>ε,δ</i>)approximation of <span class="texhtml mvar" style="font-style:italic;">F<sub>k</sub></span>, where <span class="texhtml mvar" style="font-style:italic;">F'<sub>k</sub></span> is the (<i>ε,δ</i>)-
approximated value of <span class="texhtml mvar" style="font-style:italic;">F<sub>k</sub></span>.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup> Where <i>ε</i> is the approximation parameter and <i>δ</i> is the confidence parameter.<sup id="cite_ref-:2_10-0" class="reference"><a href="#cite_note-:2-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading5"><h5 id="Calculating_F0_(distinct_elements_in_a_data_stream)">Calculating <i>F</i><sub>0</sub> (distinct elements in a data stream)</h5></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Count-distinct_problem" title="Count-distinct problem">Count-distinct problem</a></div>
<div class="mw-heading mw-heading6"><h6 id="FM-Sketch_algorithm">FM-Sketch algorithm</h6></div>
<p>Flajolet et al. in <sup id="cite_ref-:0_2-1" class="reference"><a href="#cite_note-:0-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> introduced probabilistic method of counting which was inspired from a paper by <a href="Robert_Morris_(cryptographer)" title="Robert Morris (cryptographer)">Robert Morris</a>.<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> Morris in his paper says that if the requirement of accuracy is dropped, a counter <i>n</i> can be replaced by a counter <span class="texhtml">log <i>n</i></span> which can be stored in <span class="texhtml">log log <i>n</i></span> bits.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> Flajolet et al. in <sup id="cite_ref-:0_2-2" class="reference"><a href="#cite_note-:0-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> improved this method by using a hash function <span class="texhtml mvar" style="font-style:italic;">h</span> which is assumed to uniformly distribute the element in the hash space (a binary string of length <span class="texhtml mvar" style="font-style:italic;">L</span>).
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle h:[m]\rightarrow [0,2^{L}-1]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>h</mi>
<mo>:</mo>
<mo stretchy="false">[</mo>
<mi>m</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">→<!-- → --></mo>
<mo stretchy="false">[</mo>
<mn>0</mn>
<mo>,</mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>L</mi>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle h:[m]\rightarrow [0,2^{L}-1]}</annotation>
</semantics>
</math></span><img src="./019841550fa9ae67cd9100520f432f51fda3ec98.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.231ex; height:3.176ex;" alt="{\displaystyle h:[m]\rightarrow [0,2^{L}-1]}" loading="lazy"></span></dd></dl>
<p>Let <span class="texhtml">bit(<i>y,k</i>)</span> represent the kth bit in binary representation of <span class="texhtml mvar" style="font-style:italic;">y</span>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y=\sum _{k\geq 0}\mathrm {bit} (y,k)*2^{k}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>y</mi>
<mo>=</mo>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>≥<!-- ≥ --></mo>
<mn>0</mn>
</mrow>
</munder>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">b</mi>
<mi mathvariant="normal">i</mi>
<mi mathvariant="normal">t</mi>
</mrow>
<mo stretchy="false">(</mo>
<mi>y</mi>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<mo>∗<!-- ∗ --></mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle y=\sum _{k\geq 0}\mathrm {bit} (y,k)*2^{k}}</annotation>
</semantics>
</math></span><img src="./e316e3000964c2a70f545c353763e0e153cfd96b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:20.496ex; height:5.843ex;" alt="{\displaystyle y=\sum _{k\geq 0}\mathrm {bit} (y,k)*2^{k}}" loading="lazy"></span></dd></dl>
<p>Let <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \rho (y)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>ρ<!-- ρ --></mi>
<mo stretchy="false">(</mo>
<mi>y</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \rho (y)}</annotation>
</semantics>
</math></span><img src="./c2377398a6f858722982fcfd6f510cc97bab1ae6.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.167ex; height:2.843ex;" alt="{\displaystyle \rho (y)}" loading="lazy"></span> represents the position of least
significant 1-bit in the binary representation of <span class="texhtml mvar" style="font-style:italic;">y<sub>i</sub></span> with a suitable convention for <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \rho (0)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>ρ<!-- ρ --></mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \rho (0)}</annotation>
</semantics>
</math></span><img src="./dd3300b3c092a939f5e977152e2b2b66cd9f7401.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.174ex; height:2.843ex;" alt="{\displaystyle \rho (0)}" loading="lazy"></span>.
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \rho (y)={\begin{cases}\mathrm {Min} (k:\mathrm {bit} (y,k)==1)&{\text{if }}y>0\\L&{\text{if }}y=0\end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>ρ<!-- ρ --></mi>
<mo stretchy="false">(</mo>
<mi>y</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">M</mi>
<mi mathvariant="normal">i</mi>
<mi mathvariant="normal">n</mi>
</mrow>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>:</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">b</mi>
<mi mathvariant="normal">i</mi>
<mi mathvariant="normal">t</mi>
</mrow>
<mo stretchy="false">(</mo>
<mi>y</mi>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<mo>==</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mtext>if </mtext>
</mrow>
<mi>y</mi>
<mo>></mo>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>L</mi>
</mtd>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mtext>if </mtext>
</mrow>
<mi>y</mi>
<mo>=</mo>
<mn>0</mn>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \rho (y)={\begin{cases}\mathrm {Min} (k:\mathrm {bit} (y,k)==1)&{\text{if }}y>0\\L&{\text{if }}y=0\end{cases}}}</annotation>
</semantics>
</math></span><img src="./0824e48eaf749c1985334e0e4fb2d5f026db0416.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:42.589ex; height:6.176ex;" alt="{\displaystyle \rho (y)={\begin{cases}\mathrm {Min} (k:\mathrm {bit} (y,k)==1)&{\text{if }}y>0\\L&{\text{if }}y=0\end{cases}}}" loading="lazy"></span></dd></dl>
<p>Let <i>A</i> be the sequence of data stream of length <i>M</i> whose cardinality need to be determined. Let <i>BITMAP</i> [0...<i>L</i> − 1] be the
</p><p>
hash space where the <span class="texhtml mvar" style="font-style:italic;">ρ</span>(<i>hashedvalues</i>) are recorded. The below algorithm then determines approximate cardinality of <i>A</i>.</p><pre>Procedure FM-Sketch:
for i in 0 to L − 1 do
BITMAP[i] := 0
end for
for x in A: do
Index := ρ(hash(x))
if BITMAP[index] = 0 then
BITMAP[index] := 1
end if
end for
B := Position of left most 0 bit of BITMAP[]
return 2 ^ B
</pre><p>If there are <i>N</i> distinct elements in a data stream.
</p><ul><li>For <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle i\gg \log(N)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>i</mi>
<mo>≫<!-- ≫ --></mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>N</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle i\gg \log(N)}</annotation>
</semantics>
</math></span><img src="./78e0ba7628c3af692bd2f831c300fb2d09ef5a59.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.261ex; height:2.843ex;" alt="{\displaystyle i\gg \log(N)}" loading="lazy"></span> then <i>BITMAP</i>[<i>i</i>] is certainly 0</li>
<li>For <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle i\ll \log(N)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>i</mi>
<mo>≪<!-- ≪ --></mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>N</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle i\ll \log(N)}</annotation>
</semantics>
</math></span><img src="./61ec72b3b00e0e6c8f43d568f4f106f0bb1d8e45.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.261ex; height:2.843ex;" alt="{\displaystyle i\ll \log(N)}" loading="lazy"></span> then <i>BITMAP</i>[<i>i</i>] is certainly 1</li>
<li>For <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle i\approx \log(N)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>i</mi>
<mo>≈<!-- ≈ --></mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>N</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle i\approx \log(N)}</annotation>
</semantics>
</math></span><img src="./14032f27d1d87c680d74dd82da819dce218962f1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.746ex; height:2.843ex;" alt="{\displaystyle i\approx \log(N)}" loading="lazy"></span> then <i>BITMAP</i>[<i>i</i>] is a fringes of 0's and 1's</li></ul>
<div class="mw-heading mw-heading6"><h6 id="K-minimum_value_algorithm"><i>K</i>-minimum value algorithm</h6></div>
<p>The previous algorithm describes the first attempt to approximate <i>F</i><sub>0</sub> in the data stream by Flajolet and Martin. Their algorithm picks a random <a href="Hash_function" title="Hash function">hash function</a> which they assume to uniformly distribute the hash values in hash space.
</p><p>
Bar-Yossef et al. in <sup id="cite_ref-:2_10-1" class="reference"><a href="#cite_note-:2-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> introduced k-minimum value algorithm for determining number of distinct elements in data stream. They used a similar hash function <i>h</i> which can be normalized to [0,1] as <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle h:[m]\rightarrow [0,1]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>h</mi>
<mo>:</mo>
<mo stretchy="false">[</mo>
<mi>m</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">→<!-- → --></mo>
<mo stretchy="false">[</mo>
<mn>0</mn>
<mo>,</mo>
<mn>1</mn>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle h:[m]\rightarrow [0,1]}</annotation>
</semantics>
</math></span><img src="./57eaf517acf5d0e206c5f3e995334d9804564b77.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.877ex; height:2.843ex;" alt="{\displaystyle h:[m]\rightarrow [0,1]}" loading="lazy"></span>. But they fixed a limit <i>t</i> to number of values in hash space. The value of <i>t</i> is assumed of the order <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left({\dfrac {1}{\varepsilon _{2}}}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mn>1</mn>
<msub>
<mi>ε<!-- ε --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mfrac>
</mstyle>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left({\dfrac {1}{\varepsilon _{2}}}\right)}</annotation>
</semantics>
</math></span><img src="./036a615b446f7a66f8c63e64530496706e09a860.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:8.555ex; height:6.176ex;" alt="{\displaystyle O\left({\dfrac {1}{\varepsilon _{2}}}\right)}" loading="lazy"></span> (i.e. less approximation-value <i>ε</i> requires more <i>t</i>). KMV algorithm keeps only <i>t</i>-smallest hash values in the hash space. After all the <i>m</i> values of stream have arrived, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \upsilon =\mathrm {Max} (h(a_{i}))}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>υ<!-- υ --></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">M</mi>
<mi mathvariant="normal">a</mi>
<mi mathvariant="normal">x</mi>
</mrow>
<mo stretchy="false">(</mo>
<mi>h</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \upsilon =\mathrm {Max} (h(a_{i}))}</annotation>
</semantics>
</math></span><img src="./7af025e6cd359d192dce17bb340a6137252e041b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.862ex; height:2.843ex;" alt="{\displaystyle \upsilon =\mathrm {Max} (h(a_{i}))}" loading="lazy"></span> is used to calculate<span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F'_{0}={\dfrac {t}{\upsilon }}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
<mo>′</mo>
</msubsup>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mi>t</mi>
<mi>υ<!-- υ --></mi>
</mfrac>
</mstyle>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F'_{0}={\dfrac {t}{\upsilon }}}</annotation>
</semantics>
</math></span><img src="./8bc7c5718371fd127dc4ffea0be39f7eea9c7427.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:7.739ex; height:5.176ex;" alt="{\displaystyle F'_{0}={\dfrac {t}{\upsilon }}}" loading="lazy"></span>. That is, in a close-to uniform hash space, they expect at-least <i>t</i> elements to be less than <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left({\dfrac {t}{F_{0}}}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mi>t</mi>
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mfrac>
</mstyle>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left({\dfrac {t}{F_{0}}}\right)}</annotation>
</semantics>
</math></span><img src="./2ebebf7aacba8abdefb270f417c5398b0a2234de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:8.967ex; height:6.176ex;" alt="{\displaystyle O\left({\dfrac {t}{F_{0}}}\right)}" loading="lazy"></span>.</p><pre>Procedure 2 K-Minimum Value
Initialize first t values of KMV
for a in a1 to an do
if h(a) < Max(KMV) then
Remove Max(KMV) from KMV set
Insert h(a) to KMV
end if
end for
return t/Max(KMV)
</pre>
<div class="mw-heading mw-heading6"><h6 id="Complexity_analysis_of_KMV">Complexity analysis of KMV</h6></div>
<p>KMV algorithm can be implemented in <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left(\left({\dfrac {1}{\varepsilon _{2}}}\right)\cdot \log(m)\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow>
<mrow>
<mo>(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mn>1</mn>
<msub>
<mi>ε<!-- ε --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mfrac>
</mstyle>
</mrow>
<mo>)</mo>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>m</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left(\left({\dfrac {1}{\varepsilon _{2}}}\right)\cdot \log(m)\right)}</annotation>
</semantics>
</math></span><img src="./d0354db6ee1dfc5cb9f2628ed8f761cf737f28e5.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:20.477ex; height:6.176ex;" alt="{\displaystyle O\left(\left({\dfrac {1}{\varepsilon _{2}}}\right)\cdot \log(m)\right)}" loading="lazy"></span> memory bits space. Each hash value requires space of order <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(\log(m))}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mo stretchy="false">(</mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>m</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O(\log(m))}</annotation>
</semantics>
</math></span><img src="./1e50bfd633371255c84bdf58fb6fe2585b3c11e1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.404ex; height:2.843ex;" alt="{\displaystyle O(\log(m))}" loading="lazy"></span> memory bits. There are hash values of the order <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left({\dfrac {1}{\varepsilon _{2}}}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mn>1</mn>
<msub>
<mi>ε<!-- ε --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mfrac>
</mstyle>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left({\dfrac {1}{\varepsilon _{2}}}\right)}</annotation>
</semantics>
</math></span><img src="./036a615b446f7a66f8c63e64530496706e09a860.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:8.555ex; height:6.176ex;" alt="{\displaystyle O\left({\dfrac {1}{\varepsilon _{2}}}\right)}" loading="lazy"></span>. The access time can be reduced if we store the <i>t</i> hash values in a binary tree. Thus the time complexity will be reduced to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left(\log \left({\dfrac {1}{\varepsilon }}\right)\cdot \log(m)\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow>
<mi>log</mi>
<mo><!-- --></mo>
<mrow>
<mo>(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mn>1</mn>
<mi>ε<!-- ε --></mi>
</mfrac>
</mstyle>
</mrow>
<mo>)</mo>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mi>m</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left(\log \left({\dfrac {1}{\varepsilon }}\right)\cdot \log(m)\right)}</annotation>
</semantics>
</math></span><img src="./9b121d93364465d40457d165069a1f4b138e9599.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:22.474ex; height:6.176ex;" alt="{\displaystyle O\left(\log \left({\dfrac {1}{\varepsilon }}\right)\cdot \log(m)\right)}" loading="lazy"></span>.
</p>
<div class="mw-heading mw-heading5"><h5 id="Calculating_Fk">Calculating <span class="texhtml"><i>F</i><sub>k</sub></span></h5></div>
<p>Alon et al. estimates <span class="texhtml mvar" style="font-style:italic;">F<sub>k</sub></span> by defining random variables that can be computed within given space and time.<sup id="cite_ref-:1_3-2" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> The expected value of random variables gives the approximate value of <span class="texhtml mvar" style="font-style:italic;">F<sub>k</sub></span>.
</p><p>Assume length of sequence <i>m</i> is known in advance. Then construct a random variable <i>X</i> as follows:
</p>
<ul><li>Select <span class="texhtml mvar" style="font-style:italic;">a<sub>p</sub></span> be a random member of sequence <span class="texhtml mvar" style="font-style:italic;">A</span> with index at <span class="texhtml mvar" style="font-style:italic;">p</span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{p}=l\in (1,2,3,\ldots ,n)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
</mrow>
</msub>
<mo>=</mo>
<mi>l</mi>
<mo>∈<!-- ∈ --></mo>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo>,</mo>
<mn>2</mn>
<mo>,</mo>
<mn>3</mn>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<mi>n</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a_{p}=l\in (1,2,3,\ldots ,n)}</annotation>
</semantics>
</math></span><img src="./a53fdbe8da92c48fef0834ec0d1e6575b85de90a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:22.859ex; height:3.009ex;" alt="{\displaystyle a_{p}=l\in (1,2,3,\ldots ,n)}" loading="lazy"></span></li>
<li>Let <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle r=|\{q:q\geq p,a_{q}=l\}|}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>r</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mo fence="false" stretchy="false">{</mo>
<mi>q</mi>
<mo>:</mo>
<mi>q</mi>
<mo>≥<!-- ≥ --></mo>
<mi>p</mi>
<mo>,</mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>q</mi>
</mrow>
</msub>
<mo>=</mo>
<mi>l</mi>
<mo fence="false" stretchy="false">}</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle r=|\{q:q\geq p,a_{q}=l\}|}</annotation>
</semantics>
</math></span><img src="./a49e2c81c61cd447c8b71aa62a74d6bad0cb992d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:23.154ex; height:3.009ex;" alt="{\displaystyle r=|\{q:q\geq p,a_{q}=l\}|}" loading="lazy"></span>, represents the number of occurrences of <span class="texhtml mvar" style="font-style:italic;">l</span> within the members of the sequence <span class="texhtml mvar" style="font-style:italic;">A</span> following <span class="texhtml mvar" style="font-style:italic;">a<sub>p</sub></span>.</li>
<li>Random variable <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X=m(r^{k}-(r-1)^{k})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>X</mi>
<mo>=</mo>
<mi>m</mi>
<mo stretchy="false">(</mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<mi>r</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle X=m(r^{k}-(r-1)^{k})}</annotation>
</semantics>
</math></span><img src="./a2c16aa487a3b3458f4042992d1b7116b0254ecb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:21.855ex; height:3.176ex;" alt="{\displaystyle X=m(r^{k}-(r-1)^{k})}" loading="lazy"></span>.</li></ul>
<p>Assume <i>S</i><sub>1</sub> be of the order <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n^{1-1/k}/\lambda ^{2})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mo stretchy="false">(</mo>
<msup>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>k</mi>
</mrow>
</msup>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<msup>
<mi>λ<!-- λ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O(n^{1-1/k}/\lambda ^{2})}</annotation>
</semantics>
</math></span><img src="./f9b593e70685aa10a56d9835bf1d750b7d1f5464.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.382ex; height:3.343ex;" alt="{\displaystyle O(n^{1-1/k}/\lambda ^{2})}" loading="lazy"></span> and <i>S</i><sub>2</sub> be of the order <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(\log(1/\varepsilon ))}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mo stretchy="false">(</mo>
<mi>log</mi>
<mo><!-- --></mo>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>ε<!-- ε --></mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O(\log(1/\varepsilon ))}</annotation>
</semantics>
</math></span><img src="./c76e793c79f6e276041a69d2783fae941d7e2a0f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.772ex; height:2.843ex;" alt="{\displaystyle O(\log(1/\varepsilon ))}" loading="lazy"></span>. Algorithm takes <i>S</i><sub>2</sub> random variable <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y_{1},Y_{2},...,Y_{S2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>,</mo>
<mo>.</mo>
<mo>.</mo>
<mo>.</mo>
<mo>,</mo>
<msub>
<mi>Y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>S</mi>
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle Y_{1},Y_{2},...,Y_{S2}}</annotation>
</semantics>
</math></span><img src="./cc42c7b40b1352edf34ce5e3d872a6f807b757ae.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:14.478ex; height:2.509ex;" alt="{\displaystyle Y_{1},Y_{2},...,Y_{S2}}" loading="lazy"></span> and outputs the median <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>Y</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle Y}</annotation>
</semantics>
</math></span><img src="./961d67d6b454b4df2301ac571808a3538b3a6d3f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.171ex; width:1.773ex; height:2.009ex;" alt="{\displaystyle Y}" loading="lazy"></span> . Where <span class="texhtml mvar" style="font-style:italic;">Y<sub>i</sub></span> is the average of <span class="texhtml mvar" style="font-style:italic;">X<sub>ij</sub></span> where 1 ≤ <i>j</i> ≤ <i>S</i><sub>1</sub>.
</p><p>Now calculate expectation of random variable <span class="texhtml"><i>E</i>(<i>X</i>)</span>.
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{array}{lll}E(X)&=&\sum _{i=1}^{n}\sum _{i=1}^{m_{i}}(j^{k}-(j-1)^{k})\\&=&{\frac {m}{m}}[(1^{k}+(2^{k}-1^{k})+\ldots +(m_{1}^{k}-(m_{1}-1)^{k}))\\&&\;+\;(1^{k}+(2^{k}-1^{k})+\ldots +(m_{2}^{k}-(m_{2}-1)^{k}))+\ldots \\&&\;+\;(1^{k}+(2^{k}-1^{k})+\ldots +(m_{n}^{k}-(m_{n}-1)^{k}))]\\&=&\sum _{i=1}^{n}m_{i}^{k}=F_{k}\end{array}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="left left left" rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mi>E</mi>
<mo stretchy="false">(</mo>
<mi>X</mi>
<mo stretchy="false">)</mo>
</mtd>
<mtd>
<mo>=</mo>
</mtd>
<mtd>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mrow>
</munderover>
<mo stretchy="false">(</mo>
<msup>
<mi>j</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<mi>j</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd>
<mo>=</mo>
</mtd>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mi>m</mi>
<mi>m</mi>
</mfrac>
</mrow>
<mo stretchy="false">[</mo>
<mo stretchy="false">(</mo>
<msup>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>+</mo>
<mo stretchy="false">(</mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<msup>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mo>…<!-- … --></mo>
<mo>+</mo>
<mo stretchy="false">(</mo>
<msubsup>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msubsup>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<msub>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<mn>1</mn>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd></mtd>
<mtd>
<mspace width="thickmathspace"></mspace>
<mo>+</mo>
<mspace width="thickmathspace"></mspace>
<mo stretchy="false">(</mo>
<msup>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>+</mo>
<mo stretchy="false">(</mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<msup>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mo>…<!-- … --></mo>
<mo>+</mo>
<mo stretchy="false">(</mo>
<msubsup>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msubsup>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<msub>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<mn>1</mn>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mo>…<!-- … --></mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd></mtd>
<mtd>
<mspace width="thickmathspace"></mspace>
<mo>+</mo>
<mspace width="thickmathspace"></mspace>
<mo stretchy="false">(</mo>
<msup>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>+</mo>
<mo stretchy="false">(</mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<msup>
<mn>1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mo>…<!-- … --></mo>
<mo>+</mo>
<mo stretchy="false">(</mo>
<msubsup>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msubsup>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<msub>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<mn>1</mn>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd>
<mo>=</mo>
</mtd>
<mtd>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<msubsup>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msubsup>
<mo>=</mo>
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{array}{lll}E(X)&=&\sum _{i=1}^{n}\sum _{i=1}^{m_{i}}(j^{k}-(j-1)^{k})\\&=&{\frac {m}{m}}[(1^{k}+(2^{k}-1^{k})+\ldots +(m_{1}^{k}-(m_{1}-1)^{k}))\\&&\;+\;(1^{k}+(2^{k}-1^{k})+\ldots +(m_{2}^{k}-(m_{2}-1)^{k}))+\ldots \\&&\;+\;(1^{k}+(2^{k}-1^{k})+\ldots +(m_{n}^{k}-(m_{n}-1)^{k}))]\\&=&\sum _{i=1}^{n}m_{i}^{k}=F_{k}\end{array}}}</annotation>
</semantics>
</math></span><img src="./7442038574e9d21346d4a86c5f298ec384719a01.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -8.123ex; margin-bottom: -0.215ex; width:63.663ex; height:17.843ex;" alt="{\displaystyle {\begin{array}{lll}E(X)&=&\sum _{i=1}^{n}\sum _{i=1}^{m_{i}}(j^{k}-(j-1)^{k})\\&=&{\frac {m}{m}}[(1^{k}+(2^{k}-1^{k})+\ldots +(m_{1}^{k}-(m_{1}-1)^{k}))\\&&\;+\;(1^{k}+(2^{k}-1^{k})+\ldots +(m_{2}^{k}-(m_{2}-1)^{k}))+\ldots \\&&\;+\;(1^{k}+(2^{k}-1^{k})+\ldots +(m_{n}^{k}-(m_{n}-1)^{k}))]\\&=&\sum _{i=1}^{n}m_{i}^{k}=F_{k}\end{array}}}" loading="lazy"></span></dd></dl>
<div class="mw-heading mw-heading6"><h6 id="Complexity_of_Fk">Complexity of <span class="texhtml"><i>F</i><sub>k</sub></span></h6></div>
<p>From the algorithm to calculate <span class="texhtml mvar" style="font-style:italic;">F<sub>k</sub></span> discussed above, we can see that each random variable <span class="texhtml mvar" style="font-style:italic;">X</span> stores value of <span class="texhtml mvar" style="font-style:italic;">a<sub>p</sub></span> and <span class="texhtml mvar" style="font-style:italic;">r</span>. So, to compute <span class="texhtml mvar" style="font-style:italic;">X</span> we need to maintain only <span class="texhtml">log(<i>n</i>)</span> bits for storing <span class="texhtml mvar" style="font-style:italic;">a<sub>p</sub></span> and <span class="texhtml">log(<i>n</i>)</span> bits for storing <span class="texhtml mvar" style="font-style:italic;">r</span>. Total number of random variable <span class="texhtml mvar" style="font-style:italic;">X</span> will be the <span class="nowrap"><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle S_{1}*S_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>∗<!-- ∗ --></mo>
<msub>
<mi>S</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle S_{1}*S_{2}}</annotation>
</semantics>
</math></span><img src="./23c57ca5f2ba12faa34d8fef22d3c54a043466b0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.153ex; height:2.509ex;" alt="{\displaystyle S_{1}*S_{2}}" loading="lazy"></span></span>.
</p><p>Hence the total space complexity the algorithm takes is of the order of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left({\dfrac {k\log {1 \over \varepsilon }}{\lambda ^{2}}}n^{1-{1 \over k}}\left(\log n+\log m\right)\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mrow>
<mi>k</mi>
<mi>log</mi>
<mo><!-- --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<mi>ε<!-- ε --></mi>
</mfrac>
</mrow>
</mrow>
<msup>
<mi>λ<!-- λ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mfrac>
</mstyle>
</mrow>
<msup>
<mi>n</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<mi>k</mi>
</mfrac>
</mrow>
</mrow>
</msup>
<mrow>
<mo>(</mo>
<mrow>
<mi>log</mi>
<mo><!-- --></mo>
<mi>n</mi>
<mo>+</mo>
<mi>log</mi>
<mo><!-- --></mo>
<mi>m</mi>
</mrow>
<mo>)</mo>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left({\dfrac {k\log {1 \over \varepsilon }}{\lambda ^{2}}}n^{1-{1 \over k}}\left(\log n+\log m\right)\right)}</annotation>
</semantics>
</math></span><img src="./760fbfaabfeb0aefb0588616a2d3801b73f3aaa1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:33.742ex; height:7.676ex;" alt="{\displaystyle O\left({\dfrac {k\log {1 \over \varepsilon }}{\lambda ^{2}}}n^{1-{1 \over k}}\left(\log n+\log m\right)\right)}" loading="lazy"></span>
</p>
<div class="mw-heading mw-heading6"><h6 id="Simpler_approach_to_calculate_F2">Simpler approach to calculate <span class="texhtml"><i>F</i><sub>2</sub></span></h6></div>
<p>The previous algorithm calculates <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{2}}</annotation>
</semantics>
</math></span><img src="./0fd17e0779153d765b40ebef91533489b87b2e37.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.549ex; height:2.509ex;" alt="{\displaystyle F_{2}}" loading="lazy"></span> in order of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O({\sqrt {n}}(\log m+\log n))}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mi>n</mi>
</msqrt>
</mrow>
<mo stretchy="false">(</mo>
<mi>log</mi>
<mo><!-- --></mo>
<mi>m</mi>
<mo>+</mo>
<mi>log</mi>
<mo><!-- --></mo>
<mi>n</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O({\sqrt {n}}(\log m+\log n))}</annotation>
</semantics>
</math></span><img src="./c9d32111316f8422e12d9bbfa883737eba3cb101.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:21.716ex; height:3.009ex;" alt="{\displaystyle O({\sqrt {n}}(\log m+\log n))}" loading="lazy"></span> memory bits. Alon et al. in <sup id="cite_ref-:1_3-3" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> simplified this algorithm using four-wise independent random variable with values mapped to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{-1,1\}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">{</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo>,</mo>
<mn>1</mn>
<mo fence="false" stretchy="false">}</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \{-1,1\}}</annotation>
</semantics>
</math></span><img src="./c0ffb8c7a09dad8456eee3669ee9a7e462fe3c34.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.492ex; height:2.843ex;" alt="{\displaystyle \{-1,1\}}" loading="lazy"></span>.
</p><p>This further reduces the complexity to calculate <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{2}}</annotation>
</semantics>
</math></span><img src="./0fd17e0779153d765b40ebef91533489b87b2e37.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.549ex; height:2.509ex;" alt="{\displaystyle F_{2}}" loading="lazy"></span> to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O\left({\dfrac {\log {1 \over \varepsilon }}{\lambda ^{2}}}\left(\log n+\log m\right)\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mrow>
<mo>(</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mfrac>
<mrow>
<mi>log</mi>
<mo><!-- --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<mi>ε<!-- ε --></mi>
</mfrac>
</mrow>
</mrow>
<msup>
<mi>λ<!-- λ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mfrac>
</mstyle>
</mrow>
<mrow>
<mo>(</mo>
<mrow>
<mi>log</mi>
<mo><!-- --></mo>
<mi>n</mi>
<mo>+</mo>
<mi>log</mi>
<mo><!-- --></mo>
<mi>m</mi>
</mrow>
<mo>)</mo>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O\left({\dfrac {\log {1 \over \varepsilon }}{\lambda ^{2}}}\left(\log n+\log m\right)\right)}</annotation>
</semantics>
</math></span><img src="./8a0796aeb236b6c64a6781153137cd2a476e7ec3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:26.884ex; height:7.676ex;" alt="{\displaystyle O\left({\dfrac {\log {1 \over \varepsilon }}{\lambda ^{2}}}\left(\log n+\log m\right)\right)}" loading="lazy"></span>
</p>
<div class="mw-heading mw-heading3"><h3 id="Frequent_elements">Frequent elements</h3></div>
<p>In the data stream model, the <b>frequent elements problem</b> is to output a set of elements that constitute more than some fixed fraction of the stream. A special case is the <b>majority problem</b>, which is to determine whether or not any value constitutes a majority of the stream.
</p><p>More formally, fix some positive constant <var style="padding-right: 1px;">c</var> > 1, let the length of the stream be <var style="padding-right: 1px;">m</var>, and let <var style="padding-right: 1px;">f</var><sub><var style="padding-right: 1px;">i</var></sub> denote the frequency of value <var style="padding-right: 1px;">i</var> in the stream. The frequent elements problem is to output the <a href="Set_(mathematics)" title="Set (mathematics)">set</a> { <var style="padding-right: 1px;">i</var> | <var style="padding-right: 1px;">f</var><sub><var style="padding-right: 1px;">i</var></sub> > m/c }.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p><p>Some notable algorithms are:
</p>
<ul><li><a href="Boyer%E2%80%93Moore_majority_vote_algorithm" title="Boyer–Moore majority vote algorithm">Boyer–Moore majority vote algorithm</a></li>
<li><a href="Count-Min_sketch" class="mw-redirect" title="Count-Min sketch">Count-Min sketch</a></li>
<li><a href="Lossy_Count_Algorithm" title="Lossy Count Algorithm">Lossy counting</a></li>
<li>Multi-stage <a href="Bloom_filter" title="Bloom filter">Bloom filters</a></li>
<li><a href="Misra%E2%80%93Gries_heavy_hitters_algorithm" title="Misra–Gries heavy hitters algorithm">Misra–Gries heavy hitters algorithm</a></li>
<li><a href="Misra%E2%80%93Gries_summary" title="Misra–Gries summary">Misra–Gries summary</a></li></ul>
<div class="mw-heading mw-heading3"><h3 id="Event_detection">Event detection</h3></div>
<p>Detecting events in data streams is often done using a heavy hitters algorithm as listed above: the most frequent items and their frequency are determined using one of these algorithms, then the largest increase over the previous time point is reported as trend. This approach can be refined by using exponentially weighted <a href="Moving_average" title="Moving average">moving averages</a> and variance for normalization.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Counting_distinct_elements">Counting distinct elements</h3></div>
<p>Counting the number of distinct elements in a stream (sometimes called the
<span class="texhtml"><i>F</i><sub>0</sub></span> moment) is another problem that has been well studied.
The first algorithm for it was proposed by Flajolet and Martin. In 2010, <a href="Daniel_Kane_(mathematician)" title="Daniel Kane (mathematician)">Daniel Kane</a>, <a href="Jelani_Nelson" title="Jelani Nelson">Jelani Nelson</a> and David Woodruff found an asymptotically optimal algorithm for this problem.<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> It uses <span class="texhtml"><i>O</i>(<i>ε</i><sup>2</sup> + log <i>d</i>)</span> space, with <span class="texhtml"><i>O</i>(1)</span> worst-case update and reporting times, as well as universal hash functions and a <span class="texhtml mvar" style="font-style:italic;">r</span>-wise independent hash family where <span class="texhtml"><i>r</i> = Ω(log(1/<i>ε</i>) / log log(1/<i>ε</i>))</span>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Entropy">Entropy</h3></div>
<p>The (empirical) entropy of a set of frequencies <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {a} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {a} }</annotation>
</semantics>
</math></span><img src="./1a957216653a9ee0d0133dcefd13fb75e36b8b9d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.299ex; height:1.676ex;" alt="{\displaystyle \mathbf {a} }" loading="lazy"></span> is
defined as <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle F_{k}(\mathbf {a} )=\sum _{i=1}^{n}{\frac {a_{i}}{m}}\log {\frac {a_{i}}{m}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>F</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">a</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>=</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mi>m</mi>
</mfrac>
</mrow>
<mi>log</mi>
<mo><!-- --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mi>m</mi>
</mfrac>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle F_{k}(\mathbf {a} )=\sum _{i=1}^{n}{\frac {a_{i}}{m}}\log {\frac {a_{i}}{m}}}</annotation>
</semantics>
</math></span><img src="./12e8c0ad667f140609b695bf6952b9eb63163e89.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:22.032ex; height:6.843ex;" alt="{\displaystyle F_{k}(\mathbf {a} )=\sum _{i=1}^{n}{\frac {a_{i}}{m}}\log {\frac {a_{i}}{m}}}" loading="lazy"></span>, where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle m=\sum _{i=1}^{n}a_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>m</mi>
<mo>=</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle m=\sum _{i=1}^{n}a_{i}}</annotation>
</semantics>
</math></span><img src="./d1608ef7a6bdb57aaad3d8b076bab2721528f549.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:10.91ex; height:6.843ex;" alt="{\displaystyle m=\sum _{i=1}^{n}a_{i}}" loading="lazy"></span>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Online_learning">Online learning</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Online_machine_learning" title="Online machine learning">Online machine learning</a></div>
<p>Learn a model (e.g. a <a href="Statistical_classification" title="Statistical classification">classifier</a>) by a single pass over a training set.
</p>
<ul><li><a href="Feature_hashing" title="Feature hashing">Feature hashing</a></li>
<li><a href="Stochastic_gradient_descent" title="Stochastic gradient descent">Stochastic gradient descent</a></li></ul>
<p><br>
</p>
<div class="mw-heading mw-heading2"><h2 id="Lower_bounds">Lower bounds</h2></div>
<p>Lower bounds have been computed for many of the data streaming problems
that have been studied. By far, the most common technique for computing
these lower bounds has been using <a href="Communication_complexity" title="Communication complexity">communication complexity</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Data_stream_mining" title="Data stream mining">Data stream mining</a></li>
<li><a href="Data_stream_clustering" title="Data stream clustering">Data stream clustering</a></li>
<li><a href="Online_algorithm" title="Online algorithm">Online algorithm</a></li>
<li><a href="Stream_processing" title="Stream processing">Stream processing</a></li>
<li><a href="Sequential_algorithm" title="Sequential algorithm">Sequential algorithm</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2></div>
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text">
<style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFMunroPaterson1978" class="citation conference cs1">Munro, J. Ian; Paterson, Mike (1978). "Selection and Sorting with Limited Storage". <i>19th Annual Symposium on Foundations of Computer Science, Ann Arbor, Michigan, USA, 16–18 October 1978</i>. IEEE Computer Society. pp. <span class="nowrap">253–</span>258. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FSFCS.1978.32">10.1109/SFCS.1978.32</a>.</cite></span>
</li>
<li id="cite_note-:0-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_2-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-:0_2-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFFlajoletMartin1985">Flajolet & Martin (1985)</a></span>
</li>
<li id="cite_note-:1-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-:1_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:1_3-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-:1_3-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-:1_3-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFAlonMatiasSzegedy1996">Alon, Matias & Szegedy (1996)</a></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFFeigenbaumSampath2005" class="citation journal cs1">Feigenbaum, Joan; Sampath, Kannan (2005). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.tcs.2005.09.013">"On graph problems in a semi-streaming model"</a>. <i>Theoretical Computer Science</i>. <b>348</b> (2): <span class="nowrap">207–</span>216. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.tcs.2005.09.013">10.1016/j.tcs.2005.09.013</a></span>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFBabcockBabuDatarMotwani2002" class="citation book cs1">Babcock, Brian; Babu, Shivnath; Datar, Mayur; Motwani, Rajeev; Widom, Jennifer (2002). "Models and issues in data stream systems". <i>Proceedings of the twenty-first ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems</i>. PODS '02. New York, NY, USA: ACM. pp. <span class="nowrap">1–</span>16. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.138.190">10.1.1.138.190</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F543613.543615">10.1145/543613.543615</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-58113-507-7</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2071130">2071130</a>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFBar-YossefJayramKumarSivakumar2002" class="citation book cs1">Bar-Yossef, Ziv; Jayram, T. S.; Kumar, Ravi; Sivakumar, D.; <a href="Luca_Trevisan" title="Luca Trevisan">Trevisan, Luca</a> (2002-09-13). "Counting Distinct Elements in a Data Stream". <i>Randomization and Approximation Techniques in Computer Science</i>. Lecture Notes in Computer Science. Vol. 2483. Springer, Berlin, Heidelberg. pp. <span class="nowrap">1–</span>10. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.12.6276">10.1.1.12.6276</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F3-540-45726-7_1">10.1007/3-540-45726-7_1</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-3-540-45726-8</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:4684185">4684185</a>.</cite></span>
</li>
<li id="cite_note-turnstile-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-turnstile_7-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGilbertKotidisMuthukrishnanStrauss2001">Gilbert et al. (2001)</a></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><a href="#CITEREFXu2007">Xu (2007)</a></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite id="CITEREFIndykWoodruff2005" class="citation book cs1">Indyk, Piotr; Woodruff, David (2005-01-01). "Optimal approximations of the frequency moments of data streams". <i>Proceedings of the thirty-seventh annual ACM symposium on Theory of computing</i>. STOC '05. New York, NY, USA: ACM. pp. <span class="nowrap">202–</span>208. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1060590.1060621">10.1145/1060590.1060621</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-58113-960-0</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:7911758">7911758</a>.</cite></span>
</li>
<li id="cite_note-:2-10"><span class="mw-cite-backlink">^ <a href="#cite_ref-:2_10-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:2_10-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFBar-YossefJayramKumarSivakumar2002" class="citation book cs1">Bar-Yossef, Ziv; Jayram, T. S.; Kumar, Ravi; Sivakumar, D.; Trevisan, Luca (2002-09-13). Rolim, José D. P.; Vadhan, Salil (eds.). <i>Counting Distinct Elements in a Data Stream</i>. Lecture Notes in Computer Science. Springer Berlin Heidelberg. pp. <span class="nowrap">1–</span>10. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.12.6276">10.1.1.12.6276</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F3-540-45726-7_1">10.1007/3-540-45726-7_1</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-3-540-44147-2</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:4684185">4684185</a>.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><a href="#CITEREFMorris1978">Morris (1978)</a></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite id="CITEREFFlajolet1985" class="citation journal cs1">Flajolet, Philippe (1985-03-01). "Approximate counting: A detailed analysis". <i>BIT Numerical Mathematics</i>. <b>25</b> (1): <span class="nowrap">113–</span>134. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.64.5320">10.1.1.64.5320</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2FBF01934993">10.1007/BF01934993</a>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0006-3835">0006-3835</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2809103">2809103</a>.</cite></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><cite id="CITEREFCormode2014" class="citation book cs1">Cormode, Graham (2014). "Misra-Gries Summaries". In Kao, Ming-Yang (ed.). <i>Encyclopedia of Algorithms</i>. Springer US. pp. <span class="nowrap">1–</span>5. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F978-3-642-27848-8_572-1">10.1007/978-3-642-27848-8_572-1</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-3-642-27848-8</bdi>.</cite></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite id="CITEREFSchubertWeilerKriegel2014" class="citation conference cs1">Schubert, E.; Weiler, M.; <a href="Hans-Peter_Kriegel" title="Hans-Peter Kriegel">Kriegel, H. P.</a> (2014). <i>SigniTrend: scalable detection of emerging topics in textual streams by hashed significance thresholds</i>. Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining - KDD '14. pp. <span class="nowrap">871–</span>880. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F2623330.2623740">10.1145/2623330.2623740</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-4503-2956-9</bdi>.</cite></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><a href="#CITEREFKaneNelsonWoodruff2010">Kane, Nelson & Woodruff (2010)</a></span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<ul><li><cite id="CITEREFAlonMatiasSzegedy1999" class="citation cs2"><a href="Noga_Alon" title="Noga Alon">Alon, Noga</a>; <a href="Yossi_Matias" title="Yossi Matias">Matias, Yossi</a>; <a href="Mario_Szegedy" title="Mario Szegedy">Szegedy, Mario</a> (1999), "The space complexity of approximating the frequency moments", <i><a href="Journal_of_Computer_and_System_Sciences" title="Journal of Computer and System Sciences">Journal of Computer and System Sciences</a></i>, <b>58</b> (1): <span class="nowrap">137–</span>147, <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1006%2Fjcss.1997.1545">10.1006/jcss.1997.1545</a></span>, <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0022-0000">0022-0000</a></cite>. First published as <cite id="CITEREFAlonMatiasSzegedy1996" class="citation cs2">Alon, Noga; Matias, Yossi; Szegedy, Mario (1996), "The space complexity of approximating the frequency moments", <a href="Symposium_on_Theory_of_Computing" title="Symposium on Theory of Computing"><i>Proceedings of the 28th ACM Symposium on Theory of Computing (STOC 1996)</i></a>, pp. <span class="nowrap">20–</span>29, <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.4984">10.1.1.131.4984</a></span>, <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F237814.237823">10.1145/237814.237823</a>, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0-89791-785-8</bdi>, <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:1627911">1627911</a></cite>.</li>
<li><cite id="CITEREFBabcockBabuDatarMotwani2002" class="citation cs2">Babcock, Brian; Babu, Shivnath; Datar, Mayur; <a href="Rajeev_Motwani" title="Rajeev Motwani">Motwani, Rajeev</a>; <a href="Jennifer_Widom" title="Jennifer Widom">Widom, Jennifer</a> (2002), "Models and issues in data stream systems", <a rel="nofollow" class="external text" href="https://web.archive.org/web/20170709081550/http://infolab.usc.edu/csci599/Fall2002/paper/DML2_streams-issues.pdf"><i>Proceedings of the 21st ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS 2002)</i></a> <span class="cs1-format">(PDF)</span>, pp. <span class="nowrap">1–</span>16, <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.138.190">10.1.1.138.190</a></span>, <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F543613.543615">10.1145/543613.543615</a>, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-58113-507-7</bdi>, <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2071130">2071130</a>, archived from <a rel="nofollow" class="external text" href="http://infolab.usc.edu/csci599/Fall2002/paper/DML2_streams-issues.pdf">the original</a> <span class="cs1-format">(PDF)</span> on 2017-07-09<span class="reference-accessdate">, retrieved <span class="nowrap">2013-07-15</span></span></cite>.</li>
<li><cite id="CITEREFFlajoletMartin1985" class="citation journal cs1">Flajolet, Philippe; Martin, G. Nigel (1985). <a rel="nofollow" class="external text" href="http://algo.inria.fr/flajolet/Publications/FlMa85.pdf">"Probabilistic counting algorithms for data base applications"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of Computer and System Sciences</i>. <b>31</b> (2): <span class="nowrap">182–</span>209. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0022-0000%2885%2990041-8">10.1016/0022-0000(85)90041-8</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2016-12-11</span></span>.</cite></li>
<li><cite id="CITEREFGilbertKotidisMuthukrishnanStrauss2001" class="citation cs2"><a href="Anna_C._Gilbert" title="Anna C. Gilbert">Gilbert, A. C.</a>; Kotidis, Y.; <a href="S._Muthukrishnan_(computer_scientist)" title="S. Muthukrishnan (computer scientist)">Muthukrishnan, S.</a>; Strauss, M. J. (2001), <a rel="nofollow" class="external text" href="http://www.vldb.org/conf/2001/P079.pdf">"Surfing Wavelets on Streams: One-Pass Summaries for Approximate Aggregate Queries"</a> <span class="cs1-format">(PDF)</span>, <i>Proceedings of the International Conference on Very Large Data Bases</i>: <span class="nowrap">79–</span>88</cite>.</li>
<li><cite id="CITEREFKaneNelsonWoodruff2010" class="citation conference cs1">Kane, Daniel M.; Nelson, Jelani; Woodruff, David P. (2010). "An optimal algorithm for the distinct elements problem". <i>Proceedings of the Twenty-Ninth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems</i>. PODS '10. New York, NY, USA: ACM. pp. <span class="nowrap">41–</span>52. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.164.142">10.1.1.164.142</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1807085.1807094">10.1145/1807085.1807094</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-4503-0033-9</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:10006932">10006932</a>.</cite>.</li>
<li><cite id="CITEREFKarpPapadimitriouShenker2003" class="citation cs2"><a href="Richard_Karp" class="mw-redirect" title="Richard Karp">Karp, R. M.</a>; <a href="Christos_Papadimitriou" title="Christos Papadimitriou">Papadimitriou, C. H.</a>; <a href="Scott_Shenker" title="Scott Shenker">Shenker, S.</a> (2003), "A simple algorithm for finding frequent elements in streams and bags", <i>ACM Transactions on Database Systems</i>, <b>28</b> (1): <span class="nowrap">51–</span>55, <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.116.8530">10.1.1.116.8530</a></span>, <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F762471.762473">10.1145/762471.762473</a>, <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:952840">952840</a></cite>.</li>
<li><cite id="CITEREFLallSekarOgiharaXu2006" class="citation conference cs1">Lall, Ashwin; Sekar, Vyas; Ogihara, Mitsunori; Xu, Jun; Zhang, Hui (2006). "Data streaming algorithms for estimating entropy of network traffic". <i>Proceedings of the Joint International Conference on Measurement and Modeling of Computer Systems (ACM SIGMETRICS 2006)</i>. p. 145. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1140277.1140295">10.1145/1140277.1140295</a>. <a href="Hdl_(identifier)" class="mw-redirect" title="Hdl (identifier)">hdl</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://hdl.handle.net/1802%2F2537">1802/2537</a></span>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-59593-319-5</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:240982">240982</a>.</cite>.</li>
<li><cite id="CITEREFXu2007" class="citation cs2">Xu, Jun (Jim) (2007), <a rel="nofollow" class="external text" href="http://www.cc.gatech.edu/%7Ejx/reprints/talks/sigm07_tutorial.pdf"><i>A Tutorial on Network Data Streaming</i></a> <span class="cs1-format">(PDF)</span></cite>.</li>
<li>Heath, D., Kasif, S., Kosaraju, R., Salzberg, S., Sullivan, G., "Learning Nested Concepts With Limited Storage", Proceeding IJCAI'91 Proceedings of the 12th international joint conference on Artificial intelligence - Volume 2, Pages 777–782, Morgan Kaufmann Publishers Inc. San Francisco, CA, USA ©1991</li>
<li><cite id="CITEREFMorris1978" class="citation cs2">Morris, Robert (1978), "Counting large numbers of events in small registers", <i>Communications of the ACM</i>, <b>21</b> (10): <span class="nowrap">840–</span>842, <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F359619.359627">10.1145/359619.359627</a></span>, <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:36226357">36226357</a></cite>.</li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Data_structures_and_algorithms145" style="padding:3px"><table class="nowraplinks hlist mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div id="Data_structures_and_algorithms145" style="font-size:114%;margin:0 4em"><a href="Data_structure" title="Data structure">Data structures</a> and <a href="Algorithm" title="Algorithm">algorithms</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Data structures</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Array_(data_structure)" title="Array (data structure)">Array</a></li>
<li><a href="Associative_array" title="Associative array">Associative array</a></li>
<li><a href="Binary_search_tree" title="Binary search tree">Binary search tree</a></li>
<li><a href="Fenwick_tree" title="Fenwick tree">Fenwick tree</a></li>
<li><a href="Graph_(abstract_data_type)" title="Graph (abstract data type)">Graph</a></li>
<li><a href="Hash_table" title="Hash table">Hash table</a></li>
<li><a href="Heap_(data_structure)" title="Heap (data structure)">Heap</a></li>
<li><a href="Linked_list" title="Linked list">Linked list</a></li>
<li><a href="Queue_(abstract_data_type)" title="Queue (abstract data type)">Queue</a></li>
<li><a href="Segment_tree" title="Segment tree">Segment tree</a></li>
<li><a href="Stack_(abstract_data_type)" title="Stack (abstract data type)">Stack</a></li>
<li><a href="String_(computer_science)" title="String (computer science)">String</a></li>
<li><a href="Tree_(abstract_data_type)" title="Tree (abstract data type)">Tree</a></li>
<li><a href="Trie" title="Trie">Trie</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Algorithms and <a href="Algorithmic_paradigm" title="Algorithmic paradigm">algorithmic paradigms</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Backtracking" title="Backtracking">Backtracking</a></li>
<li><a href="Binary_search" title="Binary search">Binary search</a></li>
<li><a href="Breadth-first_search" title="Breadth-first search">Breadth-first search</a></li>
<li><a href="Brute-force_search" title="Brute-force search">Brute-force search</a></li>
<li><a href="Depth-first_search" title="Depth-first search">Depth-first search</a></li>
<li><a href="Divide-and-conquer_algorithm" title="Divide-and-conquer algorithm">Divide and conquer</a></li>
<li><a href="Dynamic_programming" title="Dynamic programming">Dynamic programming</a></li>
<li><a href="Graph_traversal" title="Graph traversal">Graph traversal</a></li>
<li><a href="Fold_(higher-order_function)" title="Fold (higher-order function)">Fold</a></li>
<li><a href="Greedy_algorithm" title="Greedy algorithm">Greedy</a></li>
<li><a href="Hash_function" title="Hash function">Hash function</a></li>
<li><a href="Minimax" title="Minimax">Minimax</a></li>
<li><a href="Online_algorithm" title="Online algorithm">Online</a></li>
<li><a href="Randomized_algorithm" title="Randomized algorithm">Randomized</a></li>
<li><a href="Recursion_(computer_science)" title="Recursion (computer science)">Recursion</a></li>
<li><a href="Root-finding_algorithm" title="Root-finding algorithm">Root-finding</a></li>
<li><a href="Sorting_algorithm" title="Sorting algorithm">Sorting</a></li>
<li><a href="Sweep_line_algorithm" title="Sweep line algorithm">Sweep line</a></li>
<li><a href="String-searching_algorithm" title="String-searching algorithm">String-searching</a></li>
<li><a href="Topological_sorting" title="Topological sorting">Topological sorting</a></li></ul>
</div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div>
<ul><li><a href="List_of_data_structures" title="List of data structures">List of data structures</a></li>
<li><a href="List_of_algorithms" title="List of algorithms">List of algorithms</a></li></ul>
</div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-22" href="https://en.wikipedia.org/wiki/?title=Streaming_algorithm&oldid=1301990008">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>